import request from "@/utils/request";

// 获取列表
export function getAllList(query) {
  return request({
    url: "/houseEconomicDamageAssess/getFailureRatio",
    method: "get",
    params: query,
  });
}

// 查看
export function getEvaluationSubArea(id) {
  return request({
    url: "/houseEconomicDamageAssess/getEvaluationSubArea",
    method: "get",
    params: {
      xsemId: id
    }
  });
}
export function getHouseFinishMainCostRatioByXstmId(id) {
  return request({
    url: "/houseFinishDamageAssess/getHouseFinishMainCostRatioByXstmId",
    method: "get",
    params: {
      xstmId: id
    }
  });
}

export function getHouseFinishEconomicLossByXsemId(id, type) {
  return request({
    url: "/houseFinishDamageAssess/getHouseFinishEconomicLossByXsemId",
    method: "get",
    params: {
      xsemId: id,
      type
    }
  });
}
// 修改
export function updateHouseFinishMainCostRatio(data) {
  return request({
    url: "/houseFinishDamageAssess/updateHouseFinishMainCostRatio",
    method: "post",
    data: data
  });
}

export function getHouseFinishEconomicLossDetailByXstmId(id) {
  return request({
    url: "/houseFinishDamageAssess/getHouseFinishEconomicLossDetailByXstmId",
    method: "get",
    params: {
      xstmId: id
    }
  });
}

// 计算
export function houseFinishEconomicLossCount(data) {
  return request({
    url: "/houseFinishDamageAssess/houseFinishEconomicLossCount",
    method: "post",
    data: data
  });
}
// 计算判断
export function isHouseFinishEconomicLossCount(data) {
  return request({
    url: "/houseFinishDamageAssess/mhFinishHouseScaleReminder",
    method: "get",
    params: data
  });
}

//查看修正系数
export function getCorrectionFactorByXsemId(id) {
  return request({
    url: "/houseFinishDamageAssess/getCorrectionFactorByXsemId",
    method: "get",
    params: {
      xsemId: id
    }
  });
}
// 保存修正系数
export function saveCorrectionFactor(data) {
  return request({
    url: '/houseFinishDamageAssess/saveCorrectionFactor',
    method: "post",
    data
  })
}
//修改修正系数
export function updateCorrectionFactor(data) {
  return request({
    url: "/houseFinishDamageAssess/updateCorrectionFactor",
    method: "post",
    data: data
  });
}
// 计算各个评估子区和灾区房屋装修直接经济损失
export function disasterAreaHouseFinishEconomicLossCount(data) {
  return request({
    url: '/houseFinishDamageAssess/disasterAreaHouseFinishEconomicLossCount',
    method: "post",
    data
  })
}